
Option Strict On : Option Explicit On : Option Compare Binary : Option Infer On

Imports System
Imports System.Drawing
Imports System.Collections.Generic
Imports System.Collections.ObjectModel
Imports System.Text.RegularExpressions
Imports System.Windows.Forms.Utility


Namespace Code.Coloriser

    ''' <summary>
    ''' Code coloriser for VB.NET
    ''' </summary>
    ''' <remarks>
    ''' </remarks>
    Friend Class VBCodeColoriser
        Inherits IColorTokenProvider

        Public Overrides ReadOnly Property CaseSensitive() As Boolean
            Get
                Return False
            End Get
        End Property


        Protected Overrides ReadOnly Property CommentRegexStr() As String
            Get
                Return "(?:'|REM\s)[^\r\n]*"
            End Get
        End Property


        Protected Overrides ReadOnly Property StringOrCharRegexStr() As String
            Get
                Return """""|""[^\r\n]*?"""
            End Get
        End Property


        Protected Overrides ReadOnly Property Keywords() As String
            Get
                Return "AddHandler AddressOf AndAlso Alias And Ansi As Assembly " _
                & "Auto Boolean ByRef Byte ByVal Call Case Catch " _
                & "CBool CByte CChar CDate CDec CDbl Char CInt " _
                & "Class CLng CObj Const CShort CSng CStr CType " _
                & "Date Decimal Declare Default Delegate Dim DirectCast Do " _
                & "Double Each Else ElseIf End EndIf Enum Erase Error " _
                & "Event Exit False Finally For Friend Function Get " _
                & "GetType Global GoSub GoTo Handles If Implements Imports In Inherits " _
                & "Integer Interface Is Let Lib Like Long Loop " _
                & "Me Mod Module MustInherit MustOverride MyBase MyClass Namespace " _
                & "Narrowing New Next Not Nothing NotInheritable NotOverridable Object On " _
                & "Operator Option Optional Or OrElse Overloads Overridable Overrides ParamArray " _
                & "Preserve Private Property Protected Public RaiseEvent ReadOnly ReDim " _
                & "REM RemoveHandler Resume Return Select Set Shadows Shared " _
                & "Short Single Static Step Stop String Structure Sub " _
                & "SyncLock Then Throw To True Try TryCast TypeOf Unicode " _
                & "Until Variant Wend When While With Widening WithEvents WriteOnly Xor"
            End Get
        End Property


        Protected Overrides ReadOnly Property Preprocessors() As String
            Get
                Return "#\s*Const #\s*If #\s*Else #\s*ElseIf #\s*End\s+If " _
                & "#\s*ExternalSource #\s*End\s+ExternalSource " _
                & "#\s*Region #\s*End\s+Region"
            End Get
        End Property

    End Class

End Namespace
